Single experiment example

Leiv Rønneberg

05/09/2022

In the R package, we’ve attached two example datasets from a large drug combination screening experiment on diffuse large B-cell lymphoma. We’ll use these to show some simple use cases of the main functions and how to interpret the results.

Let’s load in the first example and have a look at it

library(bayesynergy)
data("mathews_DLBCL")
y = mathews_DLBCL[[1]][[1]]
x = mathews_DLBCL[[1]][[2]]
head(cbind(y,x))
##      Viability ibrutinib ispinesib
## [1,] 1.2295618    0.0000         0
## [2,] 1.0376006    0.1954         0
## [3,] 1.1813851    0.7812         0
## [4,] 0.5882688    3.1250         0
## [5,] 0.4666700   12.5000         0
## [6,] 0.2869514   50.0000         0

We see that the the measured viability scores are stored in the vector y, while x is a matrix with two columns giving the corresponding concentrations where the viability scores were read off.

Fitting the regression model is simple enough, and can be done on default settings simply by running the following code (where we add the names of the drugs involved, the concentration units for plotting purposes, and calculate the bayes factor).

fit = bayesynergy(y,x, drug_names = c("ibrutinib", "ispinesib"),
                  units = c("nM","nM"),bayes_factor = T)
## 
## SAMPLING FOR MODEL 'gp_grid' NOW (CHAIN 1).
## Chain 1: 
## Chain 1: Gradient evaluation took 0.000587 seconds
## Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 5.87 seconds.
## Chain 1: Adjust your expectations accordingly!
## Chain 1: 
## Chain 1: 
## Chain 1: Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1: Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1: Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1: Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1: Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1: Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1: Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1: Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1: Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1: Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1: Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1: Iteration: 2000 / 2000 [100%]  (Sampling)
## Chain 1: 
## Chain 1:  Elapsed Time: 18.0561 seconds (Warm-up)
## Chain 1:                17.068 seconds (Sampling)
## Chain 1:                35.1241 seconds (Total)
## Chain 1: 
## 
## SAMPLING FOR MODEL 'gp_grid' NOW (CHAIN 2).
## Chain 2: 
## Chain 2: Gradient evaluation took 0.000316 seconds
## Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 3.16 seconds.
## Chain 2: Adjust your expectations accordingly!
## Chain 2: 
## Chain 2: 
## Chain 2: Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2: Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2: Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2: Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2: Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2: Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2: Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2: Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2: Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2: Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2: Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2: Iteration: 2000 / 2000 [100%]  (Sampling)
## Chain 2: 
## Chain 2:  Elapsed Time: 18.6252 seconds (Warm-up)
## Chain 2:                19.1201 seconds (Sampling)
## Chain 2:                37.7454 seconds (Total)
## Chain 2: 
## 
## SAMPLING FOR MODEL 'gp_grid' NOW (CHAIN 3).
## Chain 3: 
## Chain 3: Gradient evaluation took 0.00032 seconds
## Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 3.2 seconds.
## Chain 3: Adjust your expectations accordingly!
## Chain 3: 
## Chain 3: 
## Chain 3: Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3: Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3: Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3: Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3: Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3: Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3: Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3: Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3: Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3: Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3: Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3: Iteration: 2000 / 2000 [100%]  (Sampling)
## Chain 3: 
## Chain 3:  Elapsed Time: 18.3892 seconds (Warm-up)
## Chain 3:                18.8873 seconds (Sampling)
## Chain 3:                37.2765 seconds (Total)
## Chain 3: 
## 
## SAMPLING FOR MODEL 'gp_grid' NOW (CHAIN 4).
## Chain 4: 
## Chain 4: Gradient evaluation took 0.000346 seconds
## Chain 4: 1000 transitions using 10 leapfrog steps per transition would take 3.46 seconds.
## Chain 4: Adjust your expectations accordingly!
## Chain 4: 
## Chain 4: 
## Chain 4: Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4: Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4: Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4: Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4: Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4: Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4: Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4: Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4: Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4: Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4: Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4: Iteration: 2000 / 2000 [100%]  (Sampling)
## Chain 4: 
## Chain 4:  Elapsed Time: 21.6373 seconds (Warm-up)
## Chain 4:                16.7081 seconds (Sampling)
## Chain 4:                38.3453 seconds (Total)
## Chain 4: 
## 
## SAMPLING FOR MODEL 'nointeraction' NOW (CHAIN 1).
## Chain 1: 
## Chain 1: Gradient evaluation took 0.000126 seconds
## Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 1.26 seconds.
## Chain 1: Adjust your expectations accordingly!
## Chain 1: 
## Chain 1: 
## Chain 1: Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1: Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1: Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1: Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1: Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1: Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1: Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1: Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1: Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1: Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1: Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1: Iteration: 2000 / 2000 [100%]  (Sampling)
## Chain 1: 
## Chain 1:  Elapsed Time: 2.75757 seconds (Warm-up)
## Chain 1:                3.04527 seconds (Sampling)
## Chain 1:                5.80284 seconds (Total)
## Chain 1: 
## 
## SAMPLING FOR MODEL 'nointeraction' NOW (CHAIN 2).
## Chain 2: 
## Chain 2: Gradient evaluation took 0.000101 seconds
## Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 1.01 seconds.
## Chain 2: Adjust your expectations accordingly!
## Chain 2: 
## Chain 2: 
## Chain 2: Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2: Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2: Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2: Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2: Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2: Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2: Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2: Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2: Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2: Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2: Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2: Iteration: 2000 / 2000 [100%]  (Sampling)
## Chain 2: 
## Chain 2:  Elapsed Time: 2.77665 seconds (Warm-up)
## Chain 2:                2.65496 seconds (Sampling)
## Chain 2:                5.4316 seconds (Total)
## Chain 2: 
## 
## SAMPLING FOR MODEL 'nointeraction' NOW (CHAIN 3).
## Chain 3: 
## Chain 3: Gradient evaluation took 9.6e-05 seconds
## Chain 3: 1000 transitions using 10 leapfrog steps per transition would take 0.96 seconds.
## Chain 3: Adjust your expectations accordingly!
## Chain 3: 
## Chain 3: 
## Chain 3: Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3: Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3: Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3: Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3: Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3: Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3: Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3: Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3: Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3: Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3: Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3: Iteration: 2000 / 2000 [100%]  (Sampling)
## Chain 3: 
## Chain 3:  Elapsed Time: 2.42067 seconds (Warm-up)
## Chain 3:                2.25905 seconds (Sampling)
## Chain 3:                4.67972 seconds (Total)
## Chain 3: 
## 
## SAMPLING FOR MODEL 'nointeraction' NOW (CHAIN 4).
## Chain 4: 
## Chain 4: Gradient evaluation took 9.7e-05 seconds
## Chain 4: 1000 transitions using 10 leapfrog steps per transition would take 0.97 seconds.
## Chain 4: Adjust your expectations accordingly!
## Chain 4: 
## Chain 4: 
## Chain 4: Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4: Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4: Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4: Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4: Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4: Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4: Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4: Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4: Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4: Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4: Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4: Iteration: 2000 / 2000 [100%]  (Sampling)
## Chain 4: 
## Chain 4:  Elapsed Time: 2.62844 seconds (Warm-up)
## Chain 4:                2.63523 seconds (Sampling)
## Chain 4:                5.26368 seconds (Total)
## Chain 4:
## Calculating the Bayes factor

The resulting model can be summarised by running

summary(fit)
##                 mean  se_mean     sd      2.5%       50%  97.5% n_eff  Rhat
## la_1[1]       0.3364 0.001451 0.0698  1.70e-01  3.46e-01  0.451  2315 1.001
## la_2[1]       0.3747 0.009895 0.0901  3.53e-02  3.96e-01  0.456    83 1.036
## log10_ec50_1  0.4739 0.003236 0.1498  2.46e-01  4.45e-01  0.837  2142 1.002
## log10_ec50_2 -1.0422 0.018874 0.9771 -3.21e+00 -9.20e-01  0.485  2680 1.001
## slope_1       2.0326 0.016696 0.9064  9.12e-01  1.81e+00  4.365  2947 1.000
## slope_2       1.4275 0.039567 1.1476  5.92e-02  1.16e+00  4.286   841 1.006
## ell           3.0534 0.030429 1.5102  1.26e+00  2.72e+00  6.884  2463 1.000
## sigma_f       0.8050 0.014937 0.7859  1.67e-01  5.82e-01  2.778  2769 1.000
## s             0.0971 0.000304 0.0150  7.26e-02  9.52e-02  0.132  2448 0.999
## dss_1        33.5756 0.043330 2.9606  2.76e+01  3.36e+01 39.480  4669 1.000
## dss_2        59.2931 0.051533 2.7395  5.36e+01  5.94e+01 64.490  2826 1.002
## rVUS_f       82.7355 0.013679 0.8862  8.09e+01  8.28e+01 84.436  4197 1.000
## rVUS_p0      72.9829 0.037589 2.1723  6.86e+01  7.30e+01 77.107  3340 1.000
## VUS_Delta    -9.7526 0.040124 2.3431 -1.45e+01 -9.67e+00 -5.288  3410 1.000
## VUS_syn      -9.7945 0.039432 2.3045 -1.45e+01 -9.69e+00 -5.420  3416 1.000
## VUS_ant       0.0419 0.001836 0.1053  5.07e-06  8.11e-05  0.340  3292 1.000
## 
## log-Pseudo Marginal Likelihood (LPML) =  52.0628 
## Estimated Bayes factor in favor of full model over non-interaction only model:  35.02581

which gives posterior summaries of the parameters of the model.

In addition, the model calculates summary statistics of the monotherapy curves and the dose-response surface including drug sensitivity scores (DSS) for the two drugs in question, as well as the volumes that capture the notion of efficacy (rVUS_f), interaction (VUS_Delta), synergy (VUS_syn) and interaction (VUS_ant).

As indicated, the total combined drug efficacy is around 80% (rVUS_f), of which around 70 percentage points can be attributed to \(p_0\) (rVUS_p0), leaving room for 10 percentage points worth of synergy (VUS_syn). We can also note that the model is fairly certain of this effect, with a 95% credible interval given as (-14.493, -5.42). The certainty of this is also verified by the Bayes factor, which at 35.03 indicates strong evidence of an interaction effect present in the model.

Visualization

Monotherapy curves, 2D contour plots

We can also create plots by simply running

plot(fit, plot3D = F)

which produces monotherapy curves, monotherapy summary statistics, 2D contour plots of the dose-response function \(f\), the non-interaction assumption \(p_0\) and the interaction \(\Delta\). The last plot displays the \(rVUS\) scores as discussed previously, with corresponding uncertainty.

3D interactive plots

The package can also generate 3D interactive plots by setting plot3D = T. These are displayed as following using the plotly library (Plotly Technologies Inc. (2015)).

Dose-response

Non-interaction

Interaction

References

Plotly Technologies Inc. 2015. “Collaborative Data Science.” Montreal, QC: Plotly Technologies Inc. 2015. https://plot.ly.